# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  include AuthenticatedSystem
  before_filter :login!, :except => [:login, :logout, :signup]
  # You can move this into a different controller, if you wish.  This module gives you the require_role helpers, and others.
  include RoleRequirementSystem
  # If you want "remember me" functionality, add this before_filter to Application Controller
  before_filter :login_from_cookie


  # Pick a unique cookie name to distinguish our session data from others'
  session :session_key => '_misof_session_id'

  def login!
    if logged_in?
      return true
    else
      flash[:error] = "æ¡ææé"
      redirect_to '/'
      return false
    end
  end
end
